package com.qianfeng.goods_7006.dto;



import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.Setting;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.util.Arrays;

/**
 * author: 田晋宇
 * datetime:2021/11/3 16:45
 * email:853796359@qq.com
 */

@Document(indexName = "goods",createIndex = false)
public class GoodsDto implements Serializable {


    @Id
    @Field(name = "id", type = FieldType.Keyword)
    private Integer id;

    @Field(name  ="name",analyzer = "ik_max_word", type = FieldType.Text)
    private String name;
    @Field
    private String imgurls [];
    @Field(type=FieldType.Double)
    private Double price;
    @Field(name  ="taste",analyzer = "ik_max_word", type = FieldType.Text)
    private String taste[];
    @Field(name  ="packing",analyzer = "ik_max_word", type = FieldType.Text)
    private String packing[];
    @Field
    private String detail;
    @Field(type = FieldType.Integer)
    private String type[];

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String[] getImgurls() {
        return imgurls;
    }

    public void setImgurls(String[] imgurls) {
        this.imgurls = imgurls;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public String[] getTaste() {
        return taste;
    }

    public void setTaste(String[] taste) {
        this.taste = taste;
    }

    public String[] getPacking() {
        return packing;
    }

    public void setPacking(String[] packing) {
        this.packing = packing;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public String[] getType() {
        return type;
    }

    public void setType(String[] type) {
        this.type = type;
    }

    @Override
    public String toString() {
        return "GoodsDto{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", imgurls=" + Arrays.toString(imgurls) +
                ", price=" + price +
                ", taste=" + Arrays.toString(taste) +
                ", packing=" + Arrays.toString(packing) +
                ", detail='" + detail + '\'' +
                ", type=" + Arrays.toString(type) +
                '}';
    }
}
